home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / ewl / ewl_image.h < prev    next >
C/C++ Source or Header  |  2006-01-09  |  2KB  |  80 lines

  1. #ifndef __EWL_IMAGE_H__
  2. #define __EWL_IMAGE_H__
  3.  
  4. /**
  5.  * @file ewl_image.h
  6.  * @defgroup Ewl_Image Image: An Image Display Widget
  7.  * Provides a widget for displaying evas loadable images, and edjes.
  8.  *
  9.  * @{
  10.  */
  11.  
  12. /**
  13.  * @themekey /image/file
  14.  * @themekey /image/group
  15.  */
  16.  
  17. enum Ewl_Image_Type
  18. {
  19.     EWL_IMAGE_TYPE_NORMAL, /**< Standard image type */
  20.     EWL_IMAGE_TYPE_EDJE /**< Edje image type */
  21. };
  22.  
  23. typedef enum Ewl_Image_Type Ewl_Image_Type;
  24.  
  25. typedef struct Ewl_Image Ewl_Image;
  26.  
  27. #define EWL_IMAGE(image) ((Ewl_Image *) image)
  28.  
  29. /**
  30.  * @struct Ewl_Image
  31.  *
  32.  */
  33. struct Ewl_Image
  34. {
  35.     Ewl_Widget      widget;
  36.     Ewl_Image_Type  type;
  37.     Evas_Object    *image;
  38.     char           *path;
  39.     char           *key;
  40.     char        proportional;
  41.     int         ow, oh;
  42.     double        sw, sh;
  43.     int        cs;
  44.     Evas_Coord    aw, ah;
  45.  
  46.     struct {
  47.         int set;
  48.         int x, y, w, h;
  49.     } tile;
  50. };
  51.  
  52. Ewl_Widget    *ewl_image_new(void);
  53. int         ewl_image_init(Ewl_Image *i);
  54. void         ewl_image_file_set(Ewl_Image *i, const char *im, const char *key);
  55. const char    *ewl_image_file_get(Ewl_Image *i);
  56. void         ewl_image_proportional_set(Ewl_Image *i, char p);
  57. void         ewl_image_scale(Ewl_Image *i, double wp, double hp);
  58. void         ewl_image_scale_to(Ewl_Image *i, int w, int h);
  59. void         ewl_image_tile_set(Ewl_Image *i, int x, int y, 
  60.                         int w, int h);
  61. void          ewl_image_constrain_set(Ewl_Image *i, unsigned int size);
  62. unsigned int     ewl_image_constrain_get(Ewl_Image *i);
  63.  
  64. /*
  65.  * Internally used callbacks, override at your own risk.
  66.  */
  67. void ewl_image_reveal_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  68. void ewl_image_obscure_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  69. void ewl_image_configure_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  70. void ewl_image_mouse_down_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  71. void ewl_image_mouse_up_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  72. void ewl_image_mouse_move_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  73. void ewl_image_destroy_cb(Ewl_Widget *w, void *ev_data, void *user_data );
  74.  
  75. /**
  76.  * @}
  77.  */
  78.  
  79. #endif                /* __EWL_IMAGE_H__ */
  80.